<?php if (!defined('THINK_PATH')) exit();?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
  <title>个人资料</title>
  <link rel="stylesheet" href="/lssm/Public/mobile/css/public.css">
  <link rel="stylesheet" href="/lssm/Public/mobile/css/login.css">

  <link href="/lssm/Public/css/layui.css" rel="stylesheet" type="text/css" media="all"/>
  <script type="text/javascript" src="/lssm/Public/layui.js"></script>

  <script src="/lssm/Public/mobile/js/jquery-1.8.3.min.js" type="text/javascript"></script>
  <script src="/lssm/Public/mobile/js/wxd.js" type="text/javascript"></script>

    <style type="text/css">
    .sendcode{
position: absolute;
    width: 100px !important;
    right: 0;
    top: 0;
    text-align: center;
    padding: 0 !important;
    background-color: #094;
    color: #fff;
    border-radius: 5px !important;
    cursor:pointer;
    }
  </style>
</head>
<body>
  <header class="nav">
      <a class="nav-return" href="<?php echo U('mobile/info/jz_home',array('newcity'=>$city));?>"></a>
      <h1 class="nav-title">个人信息</h1>
      <span class="nav-right">
          <a class="nav-btn-reg" href="<?php echo U('mobile/info/jz_home',array('newcity'=>$city));?>">返回</a>
      </span>
  </header>
  
  <section class="main">
      <div class="logo">
          <img width="230" height="64" class="logo" src="/lssm/Public/mobile/images/logo.png">
      </div>
      <form class="form layui-form" method="post">
            <div class="input-wrap">
              <span style=" position: absolute;padding-top: 7px;">姓名：</span>
              <input type="text" required  lay-verify="required" name="username" value="<?php echo ($jiazhang["name"]); ?>" placeholder="请输入姓名" style="padding-left: 80px;">
              <i class="i-close"></i>
          </div>
      <div class="input-wrap">性别：
          <?php if ($jiazhang['sex'] == '男') { ?>
              <input type="radio" name="sex" value="男" checked title="男">
              <input type="radio" name="sex" value="女" title="女">
          <?php }else { ?>
              <input type="radio" name="sex" value="男"  title="男">
              <input type="radio" name="sex" value="女" checked title="女">
          <?php } ?>
          </div>
          <div class="input-wrap p-city">所在城市：
              <select name="city" id="txt_city" style="height:40px;padding:6px 5px;width:100%;float:left;font-size:16px;border:1px solid #b9b9b9;border-radius:5px;-webkit-border-radius:5px;-ms-border-radius:5px;-moz-border-radius:5px;cursor:pointer;">
                <option value="<?php echo ($jiazhang["city"]); ?>">城市：<?php echo ($jiazhang["city"]); ?></option>
              <?php foreach ($citys as $c) { ?>
                <option value="<?php echo ($c["city_name"]); ?>"><?php echo ($c["city_name"]); ?></option>
              <?php } ?>                                      
              </select>
          </div>
          
          <input type="hidden" name="id" value="<?php echo ($jiazhang["id"]); ?>">
          <button class="btn-submit" style="margin-top: 20px;" lay-submit lay-filter="*">提&nbsp;&nbsp;交</button>
      </form>
  </section>
<script type="text/javascript">
    layui.use(['form','layer'], function(){
      var layer = layui.layer
      ,form = layui.form();
      //layer.msg('Hello World');

    form.on('submit(*)', function(data){
      //console.log(data);
    $.ajax({
        url: "<?php echo U('mobile/info/jz_jiben_add');?>",//请求地址
        type: "post",//请求方式
        dataType: "json",//返回数据类型
        data: data.field,//发送的参数
        })
        .done(function(response) {
              if(response.error==0){
                 layer.msg(response.info ,{icon:5});

              }else{
                 layer.msg(response.info ,{icon:6});
                 location.href = response.url;

              }
          })
        .fail(function() {
            alert("ajxs交互失败");
        })  

      return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
    });   
    });
</script>
</body>
</html>